// 笔试强训day23：字符串分类

#include <iostream>
#include <algorithm>
#include <unordered_set>
using namespace std;

int main() {
    int n = 0; cin >> n;
    string str;
    unordered_set<string> strclass;
    while(n--)
    {
        cin >> str;
        sort(str.begin(), str.end());
        strclass.insert(str);
    }
    cout << strclass.size() << endl;
}